package bubbleSort;

import shared.Buffer;

/**
 * The BubbleSorterState is a state of a BubbleSorter.
 */
public abstract class BubbleSorterState<T extends Comparable<? super T>> {

	private final BubbleSorter<T> bubbleSorter;
	
	public BubbleSorter<T> getBubbleSorter() {
		return bubbleSorter;
	}
	
	public BubbleSorterState(final BubbleSorter<T> bubbleSorter) {
		this.bubbleSorter = bubbleSorter;
	}
	
	/**
	 * Provides the sort result of this state.
	 * @return the sort result of this state.
	 */
	abstract Buffer<T> getResult();
	abstract void accept(BubbleSorterStateVisitor<T> visitor);
	
	
}
